package com.xbongbong.paas.statistics.pojo.dto;


import com.xbongbong.paas.domain.entity.BISubDataEntity;
import com.xbongbong.paas.domain.entity.PaasFormSubDataEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.enums.BiRelTableEnum;
import com.xbongbong.paas.enums.IndexTypeEnum;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.pro.domain.entity.ChartEntity;
import com.xbongbong.pro.domain.entity.ext.ChartEntityEtx;
import com.xbongbong.pro.statistic.enums.FormLocationEnum;
import com.xbongbong.pro.statistic.pojo.SlaveSourcePojo;
import com.xbongbong.saas.domain.entity.UserTeamEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 从属表
 * 创建时间： 2019/1/3 9:31 
 * 修改时间： 2019/1/3 9:31 梁鲁江
 * @author 梁鲁江
 * @since
 * @version
 */
@Setter
@Getter
@ToString
public class SlaveListDTO extends SlaveSourcePojo {
    private static final long serialVersionUID = -2714719872647603973L;
    /**
     * 从属map
     */
    @Deprecated
    @Getter(onMethod_ = {@QueryIgnore})
    private Map<Object,PaasFormDataEntityExt> slaveMap;
    @Getter(onMethod_ = {@QueryIgnore})
    private Map<Object,PaasFormDataEntityExt> slavesMap;
    @Getter(onMethod_ = {@QueryIgnore})
    private Map<Long, Set<UserTeamEntity>> slavesUserMap;
    /**
     * 关联字段的值
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Set<Object> slaveSet;
    /**
     *corpid
     */
    private String corpid;
    @Getter(onMethod_ = {@QueryIgnore})
    private IndexTypeEnum indexTypeEnum;
    @Getter(onMethod_ = {@QueryIgnore})
    private BiRelTableEnum biRelTableEnum;
    @Getter(onMethod_ = {@QueryIgnore})
    private FormLocationEnum formLocationEnum;
    /**
     * 数据源id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long warehouseId;
    /**
     * 因为要用到源字段和数据仓库字段的对应关系
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private ChartEntity chartEntity;
    /**
     * 子表单数据
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<BISubDataEntity> subList;

    /**
     * 主表的业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer driverBusinessType;

    public SlaveListDTO() {
    }

    public SlaveListDTO(Map<Object, PaasFormDataEntityExt> slavesMap, Set<Object> slaveSet, String corpid,
                        IndexTypeEnum indexTypeEnum,Integer fieldType, String linkAttr,Integer inData,Integer businessType,
                        Integer saasMark,Long formId) {
        this.slavesMap = slavesMap;
        this.slaveSet = slaveSet;
        this.corpid = corpid;
        this.indexTypeEnum = indexTypeEnum;
        this.setFormId(formId);
        this.setBusinessType(businessType);
        this.setSaasMark(saasMark);
        this.setInData(inData);
        this.setFieldType(fieldType);
        this.setLinkAttr(linkAttr);
        this.setLinkAttrCopy(linkAttr);
    }
}
